package gk.example.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DateTimeUtil {
	public static boolean isAfter(String time) {
		Date when = null;
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm");
		Date now =  new Date();
		try {
			when = simpleDateFormat.parse(time);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		
		return now.after(when);
	}
	public static boolean isBefore(String time) {
		Date when = null;
		SimpleDateFormat simpleDateFormat = new SimpleDateFormat(
				"yyyy-MM-dd HH:mm");
		Date now =  new Date();
		try {
			when = simpleDateFormat.parse(time);
		} catch (ParseException e) {
			e.printStackTrace();
		}
		
		return now.before(when);
	}
	
	
}
